package zhh.tangbao.auxiliary.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * <p>
 *     系统消息发送
 * </p>
 * @author 粥灰灰
 * <p>2023/3/28</p>
 */

@TableName(value = "system_message")
@Data
public class SystemMessage {

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /** 接收消息的用户ID */
    private String receiveUserId;

    private String title;

    private String content;

    /** 是否阅读，1：已阅，0：未阅 */
    private Integer isRead = 0;

    /** 消息发送时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date recordTime;

    /** 消息发送人，如果是系统的话通常不会有发送人ID */
    private String recordUserId;

    @TableField(exist = false)
    private String recordUserName;

    @TableField(exist = false)
    private String receiveUserName;
}
